<!-- <template>
  <div>
    <h1>测试axios</h1>
    <button @click="getUserInfo">获取用户信息</button>
  </div>
</template>
<script setup lang="ts">
import request from '@/utils/request';
import { onMounted } from 'vue';
let token="";
onMounted(()=>{
  request({
    url:"/login",
    method:'post',
    data:{
      username:"test1",
      password:"1234"
    }
  }).then(response=>{
    console.log(response);
    
    token=response.data.token
  })
})

const getUserInfo=()=>{
  request({
    url:"/user/info",
    method:'get',
    headers:{
      token
    }
  }).then(response=>{
    console.log("获取用户信息",response);
    
  })
}
</script>
<style scoped>
</style> -->
<!-- <template>
  <div>
    <h2>测试api接口封装</h2>
  </div>
</template>
<script setup lang="ts">
import { reqLogin } from "@/api/user"
import { onMounted } from "vue"
onMounted(() => {
  reqLogin({ username: 'test1', password: "1234" }).then(response => {
    console.log("登录", response.data);

  })
})
</script> -->
<template>
  <div>
    <router-view></router-view>
  </div>
</template>
<script setup lang="ts">
</script>